const mongoose = require('mongoose');

const { Schema, model } = mongoose;

const questionSchema = new Schema({
    __v: { type:Number, select: false},
    title: { type:String, required: true},//问题名称
    description: { type: String},//问题描述
    questioner: { type: Schema.Types.ObjectId, ref: 'User' ,required: true, select: false},//提问者
    topics: {
        type:[{ type: Schema.Types.ObjectId, ref: 'Topic' }],
        select: false
    }
})

module.exports = model('Question', questionSchema);